<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Exports raw image pixels</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="imagick.evaluateimage.html">Imagick::evaluateImage</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="imagick.extentimage.html">Imagick::extentImage</a></div>
 <div class="up"><a href="class.imagick.html">Imagick</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="imagick.exportimagepixels" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Imagick::exportImagePixels</h1>
  <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">Imagick::exportImagePixels</span> &mdash; <span class="dc-title">Exports raw image pixels</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-imagick.exportimagepixels-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span> <span class="methodname"><strong>Imagick::exportImagePixels</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$x</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$y</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$width</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$height</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$map</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$STORAGE</code></span>
   )</div>

  <p class="para rdfs-comment">
   Exports image pixels into an array. The map defines the ordering of the exported 
   pixels. The size of the returned array is <em>width * height * strlen(map)</em>.
   此方法在Imagick基于ImageMagick 6.4.7以上版本编译时可用。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-imagick.exportimagepixels-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">x</code></em></dt>

     <dd>

      <p class="para">
       X-coordinate of the exported area
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">y</code></em></dt>

     <dd>

      <p class="para">
       Y-coordinate of the exported area
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">width</code></em></dt>

     <dd>

      <p class="para">
       Width of the exported aread
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">height</code></em></dt>

     <dd>

      <p class="para">
       Height of the exported area
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">map</code></em></dt>

     <dd>

      <p class="para">
       Ordering of the exported pixels. For example <em>&quot;RGB&quot;</em>. 
       Valid characters for the map are R, G, B, A, O, C, Y, M, K, I and P.    
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">STORAGE</code></em></dt>

     <dd>

      <p class="para">
       Refer to this list of <a href="imagick.constants.html#imagick.constants.pixel" class="link">pixel type constants</a>
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 
 <div class="refsect1 examples" id="refsect1-imagick.exportimagepixels-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-3229">
    <p><strong>Example #1 Using <span class="function"><strong>Imagick::exportImagePixels()</strong></span></strong></p>
    <div class="example-contents"><p>
     Export image pixels into an array
    </p></div>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">/*&nbsp;Create&nbsp;new&nbsp;object&nbsp;*/<br /></span><span style="color: #0000BB">$im&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">Imagick</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">/*&nbsp;Create&nbsp;new&nbsp;image&nbsp;*/<br /></span><span style="color: #0000BB">$im</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">newPseudoImage</span><span style="color: #007700">(</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"magick:rose"</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/*&nbsp;Export&nbsp;the&nbsp;image&nbsp;pixels&nbsp;*/<br /></span><span style="color: #0000BB">$pixels&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$im</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">exportImagePixels</span><span style="color: #007700">(</span><span style="color: #0000BB">10</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">10</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">2</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">2</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"RGB"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">Imagick</span><span style="color: #007700">::</span><span style="color: #0000BB">PIXEL_CHAR</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/*&nbsp;Output&nbsp;*/<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$pixels</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
array(12) {
  [0]=&gt;
  int(72)
  [1]=&gt;
  int(64)
  [2]=&gt;
  int(57)
  [3]=&gt;
  int(69)
  [4]=&gt;
  int(59)
  [5]=&gt;
  int(43)
  [6]=&gt;
  int(124)
  [7]=&gt;
  int(120)
  [8]=&gt;
  int(-96)
  [9]=&gt;
  int(91)
  [10]=&gt;
  int(84)
  [11]=&gt;
  int(111)
}
</pre></div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-imagick.exportimagepixels-returnvalues">
   <h3 class="title">返回值</h3>
  <p class="para">
   Returns an array containing the pixels values.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-imagick.exportimagepixels-errors">
  <h3 class="title">错误／异常</h3>
  <p class="para">
   错误时抛出 ImagickException。
  </p>
 </div>



</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="imagick.evaluateimage.html">Imagick::evaluateImage</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="imagick.extentimage.html">Imagick::extentImage</a></div>
 <div class="up"><a href="class.imagick.html">Imagick</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
